package org.example.service.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @author Tang
 * @classname Bus1Service
 * @description [  ]
 * @date 2023/4/10 22:03
 */
@RabbitListener(bindings = {
        @QueueBinding(
                value = @Queue(name = "bus-queue-1"),
                exchange = @Exchange(value = "bus-exchange",type = ExchangeTypes.TOPIC)
                ,key = "*.bus1.*"
        )
})
//@Component
public class Bus1Service {

    @RabbitHandler
    public void bus1Receive(String msg) {
        System.out.println("bus1-Receive: " + msg);
    }

}